import React, { Component } from 'react';
import { Layout } from 'antd';
import { BrowserRouter as Router, Route } from 'react-router-dom';
import Nav from './Nav';
import Index from '../index';
import Classification from '../classification';
import ShopCart from '../shopCart';
import User from '../user';
import  './main.css';
class Main extends Component {
    constructor(props) {
        super(props);
        this.state = {
            pageList: [{
                name: "首页",
                icon: "home",
                link: "/index",
                component: Index
            }, {
                name: "分类",
                icon: "bars",
                link: "/classification",
                component: Classification
            }, {
                name: "购物车",
                icon: "shopping-cart",
                link: "/cart",
                component: ShopCart
            }, {
                name: "我的",
                icon: "user",
                link: "/my",
                component: User
            }]
        }
    }
    render() {
        var height = document.body.clientHeight - 50;
        return (
            <div className="main">
                <Layout className="main-content" style={{ height: height + "px" }}>
                    {this.props.children}
                </Layout>
                <Layout className="main-bottom">
                    <Nav pageList={this.state.pageList}></Nav>
                </Layout>
            </div>
        )
    }
}
export default Main;